import math
from sqlmodel import SQLModel


class Pagination(SQLModel):
    """
    分页
    """

    # 当前页码；
    page: int
    # 每页大小；
    size: int
    # 总记录数；
    total: int
    # 总页数；
    pages: int

    def __init__(self, total, page, size) -> None:
        """
        # docstring
        """
        self.total: int = total
        self.page: int = page
        self.size: int = size
        self.pages: int = math.ceil(total / size)
